<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>后台管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui-v2.5.5/css/layui.css">
    <link rel="stylesheet" href="/lib/font-v4.7.0/css/font-awesome.min.css">
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="/lib/layui-v2.5.5/layui.js"></script>
    <script src="/lib/js/index.js"></script>
    <style>
        .nav-text{
            margin-left: 5px;
        }
        #update{
            display: none;
            margin: 20px;
        }
        .hide{
            display: none;
        }
    </style>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <a href="">
            <div class="layui-logo">校园二手商城后台管理</div>
        </a>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <span th:text="${'欢迎您，管理员：'+user.getEmail()}"></span>
            </li>
            <li class="layui-nav-item"><a href="/logout">退了</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item">
                    <a href="javascript:;">
                        <i class="fa fa-cog" aria-hidden="true"></i>
                        <span class="nav-text">系统管理</span>
                    </a>
                    <dl class="layui-nav-child">
                        <dd th:class="${#httpServletRequest.getRequestURI()} == '/admin/' ? 'layui-this' : ''"><a href="/admin/">用户管理</a></dd>
                        <dd th:class="${#httpServletRequest.getRequestURI()} == '/admin/good' ? 'layui-this' : ''"><a href="/admin/good">商品管理</a></dd>
                        <dd th:class="${#httpServletRequest.getRequestURI()} == '/admin/category' ? 'layui-this' : ''"><a href="/admin/category">分类管理</a></dd>
                        <dd th:class="${#httpServletRequest.getRequestURI()} == '/admin/order' ? 'layui-this' : ''"><a href="/admin/order">订单管理</a></dd>
                        <dd th:class="${#httpServletRequest.getRequestURI()} == '/admin/message' ? 'layui-this' : ''"><a href="/admin/message">留言管理</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 25px;" id="action-body">
            <div layout:fragment="content"></div>
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © 米奇GIAOGIAO屋
    </div>
</div>
<script type="text/html" id="bar">
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>

<script>
    $('.layui-nav-itemed').removeClass('layui-nav-itemed');
    $('.layui-this').parent().parent().addClass('layui-nav-itemed');
</script>
</body>

</html>